USE [SONALIKA_BGK_UPDATED]
GO

/****** Object:  Table [dbo].[TRACTOR_PURCHASES]    Script Date: 13-May-14 1:04:59 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[TRACTOR_PURCHASES](
	[TRACTOR_ID] [int] IDENTITY(1,1) NOT NULL,
	[INVOICE_ID] [int] NOT NULL,
	[SUPPLIER_ID] [int] NOT NULL,
	[TRACTOR_MODEL_ID] [int] NOT NULL,
	[TRACTOR_ENGINE_NO] [varchar](50) NOT NULL,
	[TRACTOR_CHASSIS_NO] [varchar](50) NOT NULL,
	[TRACTOR_SPECIFICATION] [varchar](100) NOT NULL,
	[TRACTOR_FIP_NO] [varchar](50) NULL,
	[TRACTOR_ALTERNATE_MAKER] [varchar](50) NULL,
	[TRACTOR_SELFSTARTMAKER] [varchar](50) NULL,
	[TRACTOR_PDI_HOURS] [decimal](18, 2) NULL,
	[TRACTOR_SERVICE_BOOK_NO] [varchar](50) NULL,
	[TRACTOR_PURCHASE_RATE] [decimal](18, 2) NOT NULL,
	[VAT_PERCENTAGE] [decimal](18, 2) NOT NULL,
 CONSTRAINT [PK_TRACTOR_PURCHASES] PRIMARY KEY CLUSTERED 
(
	[TRACTOR_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[TRACTOR_PURCHASES]  WITH CHECK ADD  CONSTRAINT [FK_TRACTOR_PURCHASES_INVOICE] FOREIGN KEY([INVOICE_ID])
REFERENCES [dbo].[INVOICE] ([INVOICE_ID])
GO

ALTER TABLE [dbo].[TRACTOR_PURCHASES] CHECK CONSTRAINT [FK_TRACTOR_PURCHASES_INVOICE]
GO

ALTER TABLE [dbo].[TRACTOR_PURCHASES]  WITH CHECK ADD  CONSTRAINT [FK_TRACTOR_PURCHASES_SUPPLIER] FOREIGN KEY([SUPPLIER_ID])
REFERENCES [dbo].[SUPPLIER] ([SUPPLIER_ID])
GO

ALTER TABLE [dbo].[TRACTOR_PURCHASES] CHECK CONSTRAINT [FK_TRACTOR_PURCHASES_SUPPLIER]
GO

ALTER TABLE [dbo].[TRACTOR_PURCHASES]  WITH CHECK ADD  CONSTRAINT [FK_TRACTOR_PURCHASES_TRACTOR_MODELS] FOREIGN KEY([TRACTOR_MODEL_ID])
REFERENCES [dbo].[TRACTOR_MODELS] ([TRACTOR_MODEL_ID])
GO

ALTER TABLE [dbo].[TRACTOR_PURCHASES] CHECK CONSTRAINT [FK_TRACTOR_PURCHASES_TRACTOR_MODELS]
GO


